package org.htmlparser.filters;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.htmlparser.Node;
import org.htmlparser.NodeFilter;
import org.htmlparser.tags.LinkTag;

public class LinkRegexFilter
  implements NodeFilter
{
  static Class class$org$htmlparser$tags$LinkTag;
  protected Pattern mRegex;

  public LinkRegexFilter(String paramString)
  {
    this(paramString, true);
  }

  public LinkRegexFilter(String paramString, boolean paramBoolean)
  {
    if (paramBoolean)
      this.mRegex = Pattern.compile(paramString);
    while (true)
    {
      return;
      this.mRegex = Pattern.compile(paramString, 66);
    }
  }

  static Class class$(String paramString)
  {
    Class localClass;
    try
    {
      localClass = Class.forName(paramString);
      return localClass;
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
      throw new NoClassDefFoundError().initCause(localClassNotFoundException);
    }
  }

  public boolean accept(Node paramNode)
  {
    Class localClass;
    boolean bool = false;
    if (class$org$htmlparser$tags$LinkTag == null)
    {
      localClass = class$("org.htmlparser.tags.LinkTag");
      class$org$htmlparser$tags$LinkTag = localClass;
    }
    while (true)
    {
      if (localClass.isAssignableFrom(paramNode.getClass()))
      {
        String str = ((LinkTag)paramNode).getLink();
        bool = this.mRegex.matcher(str).find();
      }
      return bool;
      localClass = class$org$htmlparser$tags$LinkTag;
    }
  }
}